From 1cc207af32f822f5882cc4978a8b018f9271961a Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Mon, 23 Nov 2020 17:58:43 +0000 Subject: [PATCH] build: Tie interface age to the development cycle We don't want to increase the interface age manually, because we're going to end up forgetting about it. Instead, we should tie it to the rest of the version: - in stable (even minor) cycles, we don't add new API; the interface age is the same as the micro version - in unstable (odd minor) cycles, every new release might have new API, or updates to newly added API; keep the interface age to 0 This removes one more manual thing to change during release, and keeps us honest with our promise not to add symbols during stable cycles. --- meson.build | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/meson.build b/meson.build index 35a3b4ebd0..26f9b8e780 100644 --- a/meson.build +++ b/meson.build @@ -30,15 +30,26 @@ add_project_arguments('-DG_LOG_USE_STRUCTURED=1', language: 'c') add_project_arguments('-DGLIB_DISABLE_DEPRECATION_WARNINGS', language: 'c') # Making releases: -# 1. gtk_micro_version += 1; -# 2. gtk_interface_age += 1; -# 3. if any functions have been added, set gtk_interface_age to 0. -# 4. if backwards compatibility has been broken, we're in trouble +# 1. new development cycle: +# a. gtk_minor_version += 1 +# b. gtk_micro_version = 0 +# 2. new stable cycle: +# a. gtk_minor_version += 1 +# b. gtk_micro_version = 0 +# 3. every new release: +# a. gtk_micro_version += 1 gtk_version = meson.project_version() gtk_major_version = gtk_version.split('.')[0].to_int() gtk_minor_version = gtk_version.split('.')[1].to_int() gtk_micro_version = gtk_version.split('.')[2].to_int() -gtk_interface_age = 0 + +# Interface age gets reset during development cycles, when +# we add new API; new micro versions of the same minor +# stable cycle will have the same interface age +# +# If new API is added during a stable cycle, reset to 0 +gtk_interface_age = gtk_minor_version.is_odd() ? 0 : gtk_micro_version + add_project_arguments('-DGTK_VERSION="@0@"'.format(meson.project_version()), language: 'c') add_project_arguments('-D_GNU_SOURCE', language: 'c') -- 2.30.2